<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 玩家管理 -->
<?php if($sysAct == "add" || $sysAct == "modify"){?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=gamejs&act=list">玩家军事</a> &raquo;
	<?php if($sysAct == "add"){?>添加新军事<?php }else{ ?>编辑军事<?php } ?>
	<input type="button" value="军事列表" onclick="qgurl('admin.php?file=gamejs&act=list')">
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<form method="post" action="admin.php?file=gamejs&act=viewok&id=<?php echo $id;?>" onsubmit="return add_msg();">
<tr>
	<td class="left">兵种ID：<span style="color:red;">*</span></td>
	<td class="right"><input type="text" name="s_id" id="s_id" value="<?php echo $rs[s_id];?>">
	</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">兵种名称：<span style="color:red;">*</span></td>
	<td class="right"><input type="text" name="st_name" id="st_name" value="<?php if($rs[s_type] == "1"){?>步  卒<?php }elseif($rs[s_type] == "2"){ ?>探  子<?php }elseif($rs[s_type] == "3"){ ?>辎 重 兵<?php }elseif($rs[s_type] == "4"){ ?>扑 刀 手<?php }elseif($rs[s_type] == "5"){ ?>短 弓 手<?php }elseif($rs[s_type] == "6"){ ?>白 耳 士<?php }elseif($rs[s_type] == "7"){ ?>白马义从<?php }elseif($rs[s_type] == "8"){ ?>筑 城 队<?php }elseif($rs[s_type] == "9"){ ?>先登死士<?php }elseif($rs[s_type] == "10"){ ?>辎 重 车<?php }elseif($rs[s_type] == "11"){ ?>陷 阵 营<?php }elseif($rs[s_type] == "12"){ ?>近卫甲兵<?php }elseif($rs[s_type] == "13"){ ?>西凉铁骑<?php }elseif($rs[s_type] == "14"){ ?>无当飞军<?php }elseif($rs[s_type] == "15"){ ?>虎 豹 骑<?php }elseif($rs[s_type] == "16"){ ?>霹 雳 车<?php }elseif($rs[s_type] == "17"){ ?>弩 炮 车<?php } ?>">
<span class="clue_on">[修改无效]</span></td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">兵种说明：</td>
	<td class="right"><input type="text" name="s_description" id="s_description" value="<?php echo $rs[s_description];?>">
</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">训练要求：</td>
	<td class="right"><input type="text" name="needs" id="needs" value="<?php echo $rs[needs];?>">
<span class="clue_on">[修改无效]</span></td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">生命力：</td>
	<td class="right"><input type="text" name="s_life" id="s_life" value="<?php echo $rs[s_life];?>">
<td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">攻击力：</td>
	<td class="right"><input type="text" name="s_attack" id="s_attack" value="<?php echo $rs[s_attack];?>">
<td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">防御力：</td>
	<td class="right"><input type="text" name="s_recovery" id="s_recovery" value="<?php echo $rs[s_recovery];?>">
</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">攻击发挥：</td>
	<td class="right"><input type="text" name="attack_exert" id="attack_exert" value="<?php echo $rs[attack_exert];?>">
</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">移动速度：</td>
	<td class="right"><input type="text" name="move_spead" id="move_spead" value="<?php echo $rs[move_spead];?>">
</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">携带量：</td>
	<td class="right"><input type="text" name="take_num" id="take_num" value="<?php echo $rs[take_num];?>">
</td></tr></table></div>


<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">所需黄金：</td>
	<td class="right"><input type="text" name="s_golds" id="s_golds" value="<?php echo $rs[s_golds];?>">
</td></tr></table></div>


<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">所需木材：</td>
	<td class="right"><input type="text" name="s_woods" id="s_woods" value="<?php echo $rs[s_woods];?>">
</td></tr></table></div>


<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">所需矿石：</td>
	<td class="right"><input type="text" name="s_irons" id="s_irons" value="<?php echo $rs[s_irons];?>">
</td></tr></table></div>


<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">所需食物：</td>
	<td class="right"><input type="text" name="s_rices" id="s_rices" value="<?php echo $rs[s_rices];?>">
</td></tr></table></div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%"><tr>
	<td class="left">训练时间：</td>
	<td class="right"><input type="text" name="s_time" id="s_time" value="<?php echo $rs[s_time];?>">
<span class="clue_on">[单位为分，最小为1]</span></td></tr></table></div>





<?php $button_msg = $sysAct == "modify" ? "编辑军事" : "添加玩家";;?>
<div class="table">
<table width="100%">
<tr>
	<td class="left"></td>
	<td class="right"><input type="submit" id="creat_button" class="mybutton_01" value="<?php echo $button_msg;?>"> &nbsp; <span id="show_step" style="color:red;"></span></td>
</tr>
</form>
</table>
</div>
<script type="text/javascript">
function add_msg(msg)
{
	var username = $("username").value;
	if(!username)
	{
		alert("账号不允许为空");
		return false;
	}

	$("show_step").innerHTML = "<img src='admin/tpl/images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";

	$("creat_button").disabled = true;
}
</script>

<?php }elseif($sysAct == "list"){ ?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	玩家军事
	<input type="button" value="添加新军事" onclick="qgurl('admin.php?file=gamejs&act=add')">
</div>

<div class="table">
	<table cellpadding="1" cellspacing="0">
	<form method="post" action="admin.php?file=gamejs&act=list">
	<tr>
		<td><input type="text" name="keywords" id="keywords" value="<?php echo $keywords;?>"></td>
		<td>
			<select name="stype" id="stype">
			<option value="i_uid"<?php if($stype == "i_uid"){?> selected<?php } ?>>玩家ID</option>
			<option value="i_goodsname"<?php if($stype == "i_goodsname"){?> selected<?php } ?>>军事名称</option>
			<option value="s_id"<?php if($stype == "s_id"){?> selected<?php } ?>>种类ID</option>
			</select>
		</td>
		<td>
			<input type="submit" value="搜索" class="mybutton_01">
		</td>
		</form>
	</tr>
	</table>
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style="border-bottom:1px #D4D4D4 solid;"><img src="admin/tpl/images/blank.gif" border="0" width="1" height="1"></td>
</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0">
<tr class="table table2">
	<td height="23px" class="msg_subject_id b_b">兵种ID</td>
	<td align="center" class="msg_subject b_b">兵种名称</td>
	<td align="center" class="msg_subject b_b">兵种说明</td>
	<td align="center" class="msg_subject b_b">攻击力</td>
	<td align="center" class="msg_subject b_b">防御力</td>
	<td align="center" class="msg_subject b_b">所需黄金</td>
	<td align="center" class="msg_subject b_b">所需木材</td>
	<td align="center" class="msg_subject b_b">所需矿石</td>
	<td align="center" class="msg_subject b_b">所需食物</td>
	<td align="center" class="msg_subject b_b">所需时间</td>
	<td align="center" class="msg_postdate b_b">操作</td>
</tr>
<?php $_i=0;$rslist=(is_array($rslist))?$rslist:array();foreach($rslist AS  $key=>$valuea){$_i++; ?>
<tr class="m_out" onmouseover="this.className='m_over'" onmouseout="this.className='m_out'">
	<td height="25px" align="center" class="b_b"><?php echo $valuea[s_id];?></td>
	<td align="center" class="b_b"><?php if($valuea[s_type] == "1"){?>步  卒<?php }elseif($valuea[s_type] == "2"){ ?>探  子<?php }elseif($valuea[s_type] == "3"){ ?>辎 重 兵<?php }elseif($valuea[s_type] == "4"){ ?>扑 刀 手<?php }elseif($valuea[s_type] == "5"){ ?>短 弓 手<?php }elseif($valuea[s_type] == "6"){ ?>白 耳 士<?php }elseif($valuea[s_type] == "7"){ ?>白马义从<?php }elseif($valuea[s_type] == "8"){ ?>筑 城 队<?php }elseif($valuea[s_type] == "9"){ ?>先登死士<?php }elseif($valuea[s_type] == "10"){ ?>辎 重 车<?php }elseif($valuea[s_type] == "11"){ ?>陷 阵 营<?php }elseif($valuea[s_type] == "12"){ ?>近卫甲兵<?php }elseif($valuea[s_type] == "13"){ ?>西凉铁骑<?php }elseif($valuea[s_type] == "14"){ ?>无当飞军<?php }elseif($valuea[s_type] == "15"){ ?>虎 豹 骑<?php }elseif($valuea[s_type] == "16"){ ?>霹 雳 车<?php }elseif($valuea[s_type] == "17"){ ?>弩 炮 车<?php } ?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_description];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_attack];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_recovery];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_golds];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_woods];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_irons];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_rices];?></td>
	<td align="center" class="b_b"><?php echo $valuea[s_time];?></td>
	<td align="center" class="b_b">
		<input type="button" value="编辑" class="mybutton_01" onclick="qg_modify(<?php echo $valuea[s_id];?>)">
		<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $valuea[s_id];?>)">
	</td>
</tr>
<?php } ?>
</table>
<div align="right"><?php echo $pagelist;?></div>
<script type="text/javascript">
function qg_modify(id)
{
	window.location.href="admin.php?file=gamejs&act=modify&id="+id;
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=gamejs&act=delete&id="+id);
	}
}
</script>
<?php } ?>